<%@ page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ page language="java" import="java.util.*"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!-- Header Nav -->
<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav">
	<div class="container">
		<div class="navbar-header">
			<button class="navbar-toggle" type="button" data-toggle="collapse"
				data-target=".bs-navbar-collapse"></button>
			<s:a action="homepage" cssClass="navbar-brand"><span class="glyphicon glyphicon-home"></span> 	E-Store</s:a>
		</div>
		<nav class="collapse navbar-collapse bs-navbar-collapse">
			<ul class="nav navbar-nav navbar-right">
				<s:if test="%{#session.username != null}">
					<li><a data-toggle="dropdown" href="#"> Xin chào <span class="glyphicon glyphicon-user"></span> <s:property
								value="#session.firstName" />&nbsp;<s:property
								value="#session.lastName" /> </a>
						<ul class="dropdown-menu">
							<s:if test="#session.role <= 3 ">
								<li><s:a action="admin-homepage" cssClass="text-right">Admin Control Panel</s:a>
								</li>
							</s:if>
							<s:if test="#session.role == 1">
								<li><s:a action="webInterface-page" cssClass="text-right">Quản lý giao diện website</s:a>
								</li>
							</s:if>
							<li><s:a action="userPanel-page" cssClass="text-right">Bảng Điều Chỉnh Cá Nhân</s:a>
							</li>
							<s:if test="#session.role == 4">
								<li><s:a action="shop-page" cssClass="text-right">Đăng ký cửa hàng</s:a>
								</li>
							</s:if>
							<s:if test="#session.role == 5">
								<li><s:a action="shop-page" cssClass="text-right">Quản lý Cửa Hàng</s:a>
								</li>
								<li><s:a action="shopHome" cssClass="text-right">Trang của cửa hàng
								<s:param name="agentID"><s:property value="%{#session.shopInfo.agentID}"/></s:param>
								</s:a>
								</li>
								<li><s:a action="shopInterface-page" cssClass="text-right">Quản lý giao diện cửa hàng</s:a>
								</li>
							</s:if>
							<li class="divider"></li>
							<li><s:a action="logout" cssClass="text-right">Thoát Tài Khoản</s:a>
							</li>
						</ul>
					</li>
				</s:if>
				<s:else>
					<li><a href="#" data-toggle="modal" data-target="#myModal">Đăng Nhập</a>
					</li>
					<li><s:a action="register-page">Đăng Ký</s:a>
					</li>
				</s:else>
			</ul>
		</nav>
	</div>
</header>
<!-- Modal login -->
<div class="modal fade" id="myModal" tabindex="-1">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="row">
				<div class="col-md-11">
					<div class="col-md-12 text-center">
						<h1>Đăng Nhập</h1>
					</div>
					<s:form cssClass="form-horizontal" role="form" theme="simple"
						action="login">
						<div class="form-group">
							<label class="col-sm-3 control-label">Tài khoản</label>
							<div class="col-sm-9">
								<s:textfield cssClass="form-control" placeholder="Tài khoản"
									name="id"></s:textfield>
							</div>
						</div>
						<div class="form-group">
							<label for="inputPassword3" class="col-sm-3 control-label">Mật
								khẩu</label>
							<div class="col-sm-9">
								<s:password cssClass="form-control" placeholder="Mật khẩu"
									name="password"></s:password>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-12 text-center">
								<button type="submit" class="btn btn-default"
									onclick="this.login.reset();">Đăng Nhập</button>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-12 text-center">
								<s:a action="forgetPwd-page">Quên mật khẩu</s:a>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-12 text-center">
								<s:a action="register-page">Đăng ký</s:a>
							</div>
						</div>
					</s:form>
				</div>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- END MODAL LOGIN -->